﻿using System;
using System.Collections.Generic;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using WP8.Paneles.Resources;
using System.Windows.Shapes;
using System.Windows.Media;

namespace WP8.Paneles
{
    public partial class MainPage : PhoneApplicationPage
    {
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            // Sample code to localize the ApplicationBar
            //BuildLocalizedApplicationBar();
        }

        private void btnAccion1_Click(object sender, RoutedEventArgs e)
        {
            //GRID
            //var actualRow = Grid.GetRow(this.img);
            //Grid.SetRow(this.img, actualRow + 1);
            //Grid.SetColumnSpan(this.img, 2);

            //SP
            //sp.Children.RemoveAt(0);
            //sp.Children.Add(rec1);

            //CANVAS
            //foreach (var item in cnv.Children)
            //{
            //    MessageBox.Show("Z-Index: " + Canvas.GetZIndex(item).ToString() + "\n" +
            //        "Top: " + Canvas.GetTop(item).ToString() + "\n" +
            //        "Left: " + Canvas.GetLeft(item).ToString());
            //}
        }

        private void btnAccion2_Click(object sender, RoutedEventArgs e)
        {
            //GRID
            //grid.Children.Remove(this.rec);
            //grid.Children.Add(new Rectangle() { Fill = new SolidColorBrush(Colors.Red), Height = 22 });
            //Grid.SetColumn(grid.Children[1] as FrameworkElement, 1);

            //SP
            //foreach (FrameworkElement item in sp.Children)
            //    item.Width = 200;

            //CANVAS
            //Canvas.SetZIndex(blueRec, 1);
            //Canvas.SetLeft(blueRec, 30);
        }
    }
}